<include file="public@header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a >列表</a></li>
        <li><a href="{:url('question/add', ['reading_id' => input('reading_id')])}">添加</a></li>
        <li><a href="{:url('question/importquestion')}">导入试题</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('question/index')}">

        类型：
        <select class="form-control" name="typeid">
            <option value="">全部</option>
            <volist name="type" id="v">
                <option value="{$key}" <if condition="input('request.typeid') neq '' && input('request.typeid') eq $key">selected</if>>{$v}</option>
            </volist>
        </select>
        关键字：
        <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
               placeholder="标题">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('question/index')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form" action="">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>类型</th>
                <th>题目</th>
                <th>分值</th>
                <th>积分</th>
                <th align="center">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo['id']}</td>
                    <td>{$type[$vo['type']]}</td>
                    <td>{$vo['title']}</td>
                    <td>{$vo['score']}</td>
                    <td>{$vo['integral']}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href='{:url("question/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('question/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>

    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>